/**
 * 关卡闪屏
 * created by Five on 2018-12-25 17:24:19
 */
const { ccclass, property } = cc._decorator;

@ccclass
export default class UISplash extends cc.Component {
    @property(cc.Label)
    gateName: cc.Label = null;

    start() {
        this.close();
    }

    close() {
        this.node.active = false;
    }

    setName(name: string, callback: Function) {
        this.gateName.string = name;
        this.node.active = true;

        setTimeout(() => {
            this.close();
            callback();
        }, 4000);
    }
}
